package com.um.jdy.platform.shop.controller;

import com.um.jdy.platform.shop.entity.dto.KeywordPageDTO;
import com.um.jdy.platform.shop.manager.KeywordManager;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.LoginRequired;
import com.um.jdy.common.shop.service.KeywordService;
import com.um.jdy.common.shop.entity.po.Keyword;
import com.um.jdy.common.shop.entity.dto.KeywordDTO;
import com.um.jdy.common.shop.entity.vo.KeywordVO;
import com.um.springboot.starter.orm.controller.BaseCMSController;
import com.um.springboot.starter.orm.controller.BasePlusController;
import com.um.springboot.starter.orm.entity.Response;
import com.um.springboot.starter.orm.manager.BasePlusManager;
import com.um.springboot.starter.orm.params.ListDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 控制器：
 */
@RestController
@RequestMapping("/api/v1/cms/shop/keyword")
@Api(tags = "搜索关键字")
@ApiPermission("keyword")
@LoginRequired
public class KeywordController extends BasePlusController<KeywordManager,KeywordService,Keyword,KeywordDTO,KeywordVO, KeywordPageDTO, ListDTO> {

    @ApiPermission("set")
    @ApiOperation("搜索栏显示")
    @PutMapping({"{id}/in_search_input"})
    public Response<Keyword> setInSearchInput(@PathVariable String id, @RequestParam String in_search_input) {
        KeywordDTO keywordDTO = new KeywordDTO();
        keywordDTO.setInSearchInput(in_search_input);
        return this.manager.setInSearchInput(id, keywordDTO);
    }

}
